package com.yq.cp.config;


import com.yq.cp.entity.common.ErrorCode;

/**
 * 自定义异常类
 */
public class MyException extends RuntimeException {

    public MyException(String msg) {
        this.msg = msg;
        this.code = 101;
    }
    public MyException(int code,String msg) {
        this.msg = msg;
        this.code = code;
    }
    public MyException(ErrorCode errorCodeUtil) {
        this.msg = errorCodeUtil.getMsg();
        this.code = errorCodeUtil.getCode();
    }

    private String msg;
    private int code;

    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }


}
